package android.support.v4.app;

import I;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.ScaleAnimation;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;

final class m extends l
{
  static final Interpolator A;
  static final Interpolator B;
  static final Interpolator C;
  static boolean a;
  static final boolean b;
  static final Interpolator z;
  ArrayList c;
  Runnable[] d;
  boolean e;
  ArrayList f;
  ArrayList g;
  ArrayList h;
  ArrayList i;
  ArrayList j;
  ArrayList k;
  ArrayList l;
  ArrayList m;
  int n = 0;
  FragmentActivity o;
  k p;
  Fragment q;
  boolean r;
  boolean s;
  boolean t;
  String u;
  boolean v;
  Bundle w = null;
  SparseArray x = null;
  Runnable y = new n(this);

  static
  {
    int i1 = 0;
    a = false;
    if (Build.VERSION.SDK_INT >= 11)
      i1 = 1;
    b = i1;
    z = new DecelerateInterpolator(2.5F);
    A = new DecelerateInterpolator(1.5F);
    B = new AccelerateInterpolator(2.5F);
    C = new AccelerateInterpolator(1.5F);
  }

  private Fragment a(Bundle paramBundle, String paramString)
  {
    Fragment localFragment;
    int i1 = paramBundle.getInt(paramString, -1);
    if (i1 == -1)
      paramBundle = null;
    do
    {
      return paramBundle;
      if (i1 >= this.f.size())
        a(new IllegalStateException("Fragement no longer exists for key " + paramString + ": index " + i1));
      localFragment = (Fragment)this.f.get(i1);
      paramBundle = localFragment;
    }
    while (localFragment != null);
    a(new IllegalStateException("Fragement no longer exists for key " + paramString + ": index " + i1));
    return localFragment;
  }

  private static Animation a(float paramFloat1, float paramFloat2)
  {
    AlphaAnimation localAlphaAnimation = new AlphaAnimation(paramFloat1, paramFloat2);
    localAlphaAnimation.setInterpolator(A);
    localAlphaAnimation.setDuration(220L);
    return localAlphaAnimation;
  }

  private static Animation a(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4)
  {
    AnimationSet localAnimationSet = new AnimationSet(false);
    Object localObject = new ScaleAnimation(paramFloat1, paramFloat2, paramFloat1, paramFloat2, 1, 0.5F, 1, 0.5F);
    ((ScaleAnimation)localObject).setInterpolator(z);
    ((ScaleAnimation)localObject).setDuration(220L);
    localAnimationSet.addAnimation((Animation)localObject);
    localObject = new AlphaAnimation(paramFloat3, paramFloat4);
    ((AlphaAnimation)localObject).setInterpolator(A);
    ((AlphaAnimation)localObject).setDuration(220L);
    localAnimationSet.addAnimation((Animation)localObject);
    return ((Animation)localAnimationSet);
  }

  private Animation a(Fragment paramFragment, int paramInt1, boolean paramBoolean, int paramInt2)
  {
    int i1 = paramFragment.G;
    Fragment.c();
    if (paramFragment.G != 0)
    {
      paramFragment = AnimationUtils.loadAnimation(this.o, paramFragment.G);
      if (paramFragment != null)
        return paramFragment;
    }
    if (paramInt1 == 0)
      return null;
    i1 = -1;
    switch (paramInt1)
    {
    default:
    case 4097:
    case 8194:
    case 4099:
    }
    for (paramInt1 = i1; paramInt1 < 0; paramInt1 = 6)
      while (true)
      {
        return null;
        if (paramBoolean)
          paramInt1 = 1;
        paramInt1 = 2;
        continue;
        if (paramBoolean)
          paramInt1 = 3;
        paramInt1 = 4;
        continue;
        if (!(paramBoolean))
          break;
        paramInt1 = 5;
      }
    switch (paramInt1)
    {
    default:
      paramInt1 = paramInt2;
      if (paramInt2 == 0)
      {
        paramInt1 = paramInt2;
        if (this.o.getWindow() != null)
          paramInt1 = this.o.getWindow().getAttributes().windowAnimations;
      }
      if (paramInt1 == 0)
        return null;
    case 1:
      return a(1.125F, 1.0F, 0.0F, 1.0F);
    case 2:
      return a(1.0F, 0.975F, 1.0F, 0.0F);
    case 3:
      return a(0.975F, 1.0F, 0.0F, 1.0F);
    case 4:
      return a(1.0F, 1.075F, 1.0F, 0.0F);
    case 5:
      return a(0.0F, 1.0F);
    case 6:
    }
    return a(1.0F, 0.0F);
    return null;
  }

  private void a(int paramInt, a parama)
  {
    monitorenter;
    try
    {
      if (this.k == null)
        this.k = new ArrayList();
      int i2 = this.k.size();
      int i1 = i2;
      if (paramInt < i2)
      {
        if (a)
          Log.v("FragmentManager", "Setting back stack index " + paramInt + " to " + parama);
        this.k.set(paramInt, parama);
        return;
      }
      while (i1 < paramInt)
      {
        this.k.add(null);
        if (this.l == null)
          this.l = new ArrayList();
        if (a)
          Log.v("FragmentManager", "Adding available back stack index " + i1);
        this.l.add(Integer.valueOf(i1));
        i1 += 1;
      }
      if (a)
        Log.v("FragmentManager", "Adding back stack index " + paramInt + " with " + parama);
    }
    finally
    {
      monitorexit;
    }
  }

  private void a(RuntimeException paramRuntimeException)
  {
    Log.e("FragmentManager", paramRuntimeException.getMessage());
    Log.e("FragmentManager", "Activity state:");
    PrintWriter localPrintWriter = new PrintWriter(new android.support.v4.c.b("FragmentManager"));
    if (this.o != null);
    try
    {
      this.o.dump("  ", null, localPrintWriter, new String[0]);
      throw paramRuntimeException;
    }
    catch (Exception localException2)
    {
      while (true)
      {
        while (true)
          Log.e("FragmentManager", "Failed dumping state", localException1);
        try
        {
          a("  ", null, localException1, new String[0]);
        }
        catch (Exception localException2)
        {
          Log.e("FragmentManager", "Failed dumping state", localException2);
        }
      }
    }
  }

  private void b(Fragment paramFragment)
  {
    if (paramFragment.J == null)
      return;
    if (this.x == null)
      this.x = new SparseArray();
    while (true)
    {
      do
        paramFragment.J.saveHierarchyState(this.x);
      while (this.x.size() <= 0);
      paramFragment.e = this.x;
      this.x = null;
      return;
      this.x.clear();
    }
  }

  private static int c(int paramInt)
  {
    switch (paramInt)
    {
    default:
      return 0;
    case 4097:
      return 8194;
    case 8194:
      return 4097;
    case 4099:
    }
    return 4099;
  }

  private void n()
  {
    int i1;
    if (this.f == null);
    do
    {
      return;
      i1 = 0;
    }
    while (i1 >= this.f.size());
    Fragment localFragment = (Fragment)this.f.get(i1);
    if ((localFragment != null) && (localFragment.K))
    {
      if (!(this.e))
        break label63;
      this.v = true;
    }
    while (true)
    {
      while (true)
        i1 += 1;
      label63: localFragment.K = false;
      a(localFragment, this.n, 0, 0, false);
    }
  }

  private void o()
  {
    if (this.s)
      throw new IllegalStateException("Can not perform this action after onSaveInstanceState");
    if (this.u == null)
      return;
    throw new IllegalStateException("Can not perform this action inside of " + this.u);
  }

  public final int a(a parama)
  {
    monitorenter;
    try
    {
      if ((this.l == null) || (this.l.size() <= 0))
      {
        if (this.k == null)
          this.k = new ArrayList();
        i1 = this.k.size();
        if (a)
          Log.v("FragmentManager", "Setting back stack index " + i1 + " to " + parama);
        this.k.add(parama);
        return i1;
      }
      int i1 = ((Integer)this.l.remove(this.l.size() - 1)).intValue();
      if (a)
        Log.v("FragmentManager", "Adding back stack index " + i1 + " with " + parama);
      this.k.set(i1, parama);
      return i1;
    }
    finally
    {
      monitorexit;
    }
  }

  public final Fragment a(String paramString)
  {
    int i1;
    Object localObject;
    if ((this.g != null) && (paramString != null))
    {
      i1 = this.g.size() - 1;
      while (i1 >= 0)
      {
        localObject = (Fragment)this.g.get(i1);
        if ((localObject != null) && (paramString.equals(((Fragment)localObject).y)))
          return localObject;
        i1 -= 1;
      }
    }
    if ((this.f != null) && (paramString != null))
    {
      i1 = this.f.size() - 1;
      while (i1 >= 0)
      {
        Fragment localFragment;
        do
        {
          localFragment = (Fragment)this.f.get(i1);
          if (localFragment == null)
            break;
          localObject = localFragment;
        }
        while (paramString.equals(localFragment.y));
        i1 -= 1;
      }
    }
    return ((Fragment)null);
  }

  public final t a()
  {
    return new a(this);
  }

  final void a(int paramInt)
  {
    a(paramInt, 0, 0, false);
  }

  final void a(int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)
  {
    Object localObject;
    if ((this.o == null) && (paramInt1 != 0))
      throw new IllegalStateException("No activity");
    if ((!(paramBoolean)) && (this.n == paramInt1));
    do
    {
      return;
      this.n = paramInt1;
    }
    while (this.f == null);
    int i1 = 0;
    boolean bool = false;
    if (i1 < this.f.size())
    {
      localObject = (Fragment)this.f.get(i1);
      if (localObject == null)
        break label190;
      a((Fragment)localObject, paramInt1, paramInt2, paramInt3, false);
      if (((Fragment)localObject).M == null)
        break label190;
      bool |= ((Fragment)localObject).M.a();
    }
    while (true)
    {
      do
      {
        while (true)
          i1 += 1;
        if (bool)
          continue;
        n();
      }
      while ((!(this.r)) || (this.o == null) || (this.n != 5));
      localObject = this.o;
      if (Build.VERSION.SDK_INT >= 11)
        ((Activity)localObject).invalidateOptionsMenu();
      while (true)
      {
        this.r = false;
        return;
        label190: ((FragmentActivity)localObject).i = true;
      }
    }
  }

  public final void a(Configuration paramConfiguration)
  {
    if (this.g == null)
      return;
    int i1 = 0;
    while (i1 < this.g.size())
    {
      Fragment localFragment = (Fragment)this.g.get(i1);
      if (localFragment != null)
      {
        localFragment.onConfigurationChanged(paramConfiguration);
        if (localFragment.u != null)
          localFragment.u.a(paramConfiguration);
      }
      i1 += 1;
    }
  }

  final void a(Parcelable paramParcelable, ArrayList paramArrayList)
  {
    Object localObject1;
    Object localObject2;
    if (paramParcelable == null);
    do
    {
      return;
      paramParcelable = (FragmentManagerState)paramParcelable;
    }
    while (paramParcelable.a == null);
    if (paramArrayList != null)
    {
      i1 = 0;
      while (i1 < paramArrayList.size())
      {
        localObject1 = (Fragment)paramArrayList.get(i1);
        if (a)
          Log.v("FragmentManager", "restoreAllState: re-attaching retained " + localObject1);
        localObject2 = paramParcelable.a[localObject1.f];
        ((FragmentState)localObject2).k = ((Fragment)localObject1);
        ((Fragment)localObject1).e = null;
        ((Fragment)localObject1).r = 0;
        ((Fragment)localObject1).p = false;
        ((Fragment)localObject1).l = false;
        ((Fragment)localObject1).i = null;
        if (((FragmentState)localObject2).j != null)
        {
          ((FragmentState)localObject2).j.setClassLoader(this.o.getClassLoader());
          ((Fragment)localObject1).e = ((FragmentState)localObject2).j.getSparseParcelableArray("android:view_state");
        }
        i1 += 1;
      }
    }
    this.f = new ArrayList(paramParcelable.a.length);
    if (this.h != null)
      this.h.clear();
    int i1 = 0;
    if (i1 < paramParcelable.a.length)
    {
      localObject1 = paramParcelable.a[i1];
      if (localObject1 != null)
      {
        localObject2 = this.o;
        Fragment localFragment = this.q;
        if (((FragmentState)localObject1).k == null)
        {
          if (((FragmentState)localObject1).i != null)
            ((FragmentState)localObject1).i.setClassLoader(((FragmentActivity)localObject2).getClassLoader());
          ((FragmentState)localObject1).k = Fragment.a((Context)localObject2, ((FragmentState)localObject1).a, ((FragmentState)localObject1).i);
          if (((FragmentState)localObject1).j != null)
          {
            ((FragmentState)localObject1).j.setClassLoader(((FragmentActivity)localObject2).getClassLoader());
            ((FragmentState)localObject1).k.d = ((FragmentState)localObject1).j;
          }
          ((FragmentState)localObject1).k.a(((FragmentState)localObject1).b, localFragment);
          ((FragmentState)localObject1).k.o = ((FragmentState)localObject1).c;
          ((FragmentState)localObject1).k.q = true;
          ((FragmentState)localObject1).k.w = ((FragmentState)localObject1).d;
          ((FragmentState)localObject1).k.x = ((FragmentState)localObject1).e;
          ((FragmentState)localObject1).k.y = ((FragmentState)localObject1).f;
          ((FragmentState)localObject1).k.B = ((FragmentState)localObject1).g;
          ((FragmentState)localObject1).k.A = ((FragmentState)localObject1).h;
          ((FragmentState)localObject1).k.s = ((FragmentActivity)localObject2).b;
          if (a)
            Log.v("FragmentManager", "Instantiated fragment " + ((FragmentState)localObject1).k);
        }
        localObject2 = ((FragmentState)localObject1).k;
        if (a)
          Log.v("FragmentManager", "restoreAllState: active #" + i1 + ": " + localObject2);
        this.f.add(localObject2);
        ((FragmentState)localObject1).k = null;
      }
      while (true)
      {
        while (true)
          i1 += 1;
        this.f.add(null);
        if (this.h == null)
          this.h = new ArrayList();
        if (a)
          Log.v("FragmentManager", "restoreAllState: avail #" + i1);
        this.h.add(Integer.valueOf(i1));
      }
    }
    if (paramArrayList != null)
    {
      i1 = 0;
      if (i1 < paramArrayList.size())
      {
        localObject1 = (Fragment)paramArrayList.get(i1);
        if (((Fragment)localObject1).j >= 0)
          if (((Fragment)localObject1).j >= this.f.size())
            break label678;
        for (((Fragment)localObject1).i = ((Fragment)this.f.get(((Fragment)localObject1).j)); ; ((Fragment)localObject1).i = null)
        {
          while (true)
            i1 += 1;
          label678: Log.w("FragmentManager", "Re-attaching retained fragment " + localObject1 + " target no longer exists: " + ((Fragment)localObject1).j);
        }
      }
    }
    if (paramParcelable.b != null)
    {
      this.g = new ArrayList(paramParcelable.b.length);
      i1 = 0;
      while (true)
      {
        if (i1 >= paramParcelable.b.length)
          break label900;
        paramArrayList = (Fragment)this.f.get(paramParcelable.b[i1]);
        if (paramArrayList == null)
          a(new IllegalStateException("No instantiated fragment for index #" + paramParcelable.b[i1]));
        paramArrayList.l = true;
        if (a)
          Log.v("FragmentManager", "restoreAllState: added #" + i1 + ": " + paramArrayList);
        if (this.g.contains(paramArrayList))
          throw new IllegalStateException("Already added!");
        this.g.add(paramArrayList);
        i1 += 1;
      }
    }
    this.g = null;
    if (paramParcelable.c != null)
    {
      label900: this.i = new ArrayList(paramParcelable.c.length);
      i1 = 0;
      while (true)
      {
        if (i1 < paramParcelable.c.length);
        paramArrayList = paramParcelable.c[i1].a(this);
        if (a)
        {
          Log.v("FragmentManager", "restoreAllState: back stack #" + i1 + " (index " + paramArrayList.o + "): " + paramArrayList);
          paramArrayList.a("  ", new PrintWriter(new android.support.v4.c.b("FragmentManager")), false);
        }
        this.i.add(paramArrayList);
        if (paramArrayList.o >= 0)
          a(paramArrayList.o, paramArrayList);
        i1 += 1;
      }
    }
    this.i = null;
  }

  final void a(Fragment paramFragment)
  {
    a(paramFragment, this.n, 0, 0, false);
  }

  public final void a(Fragment paramFragment, int paramInt1, int paramInt2)
  {
    if (a)
      Log.v("FragmentManager", "remove: " + paramFragment + " nesting=" + paramFragment.r);
    if (paramFragment.r > 0)
    {
      i1 = 1;
      if (i1 != 0)
        break label142;
      i1 = 1;
      if ((!(paramFragment.A)) || (i1 != 0))
      {
        if (this.g != null)
          this.g.remove(paramFragment);
        if ((paramFragment.D) && (paramFragment.E))
          this.r = true;
        paramFragment.l = false;
        paramFragment.m = true;
        if (i1 == 0)
          break label148;
      }
    }
    label142: label148: for (int i1 = 0; ; i1 = 1)
      while (true)
      {
        while (true)
        {
          a(paramFragment, i1, paramInt1, paramInt2, false);
          return;
          i1 = 0;
        }
        i1 = 0;
      }
  }

  final void a(Fragment paramFragment, int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)
  {
    label28: int i3;
    Object localObject2;
    if (paramFragment.l)
    {
      i1 = paramInt1;
      if (!(paramFragment.A))
        break label28;
    }
    int i1 = paramInt1;
    if (paramInt1 > 1)
      i1 = 1;
    int i2 = i1;
    if (paramFragment.m)
    {
      i2 = i1;
      if (i1 > paramFragment.a)
        i2 = paramFragment.a;
    }
    paramInt1 = i2;
    if (paramFragment.K)
    {
      paramInt1 = i2;
      if (paramFragment.a < 4)
      {
        paramInt1 = i2;
        if (i2 > 3)
          paramInt1 = 3;
      }
    }
    if (paramFragment.a < paramInt1)
    {
      if ((paramFragment.o) && (!(paramFragment.p)))
        return;
      if (paramFragment.b != null)
      {
        paramFragment.b = null;
        a(paramFragment, paramFragment.c, 0, 0, true);
      }
      i1 = paramInt1;
      i3 = paramInt1;
      i2 = paramInt1;
      switch (paramFragment.a)
      {
      default:
        i1 = paramInt1;
        paramFragment.a = i1;
        return;
      case 0:
        if (a)
          Log.v("FragmentManager", "moveto CREATED: " + paramFragment);
        i2 = paramInt1;
        if (paramFragment.d != null)
        {
          paramFragment.e = paramFragment.d.getSparseParcelableArray("android:view_state");
          paramFragment.i = a(paramFragment.d, "android:target_state");
          if (paramFragment.i != null)
            paramFragment.k = paramFragment.d.getInt("android:target_req_state", 0);
          paramFragment.L = paramFragment.d.getBoolean("android:user_visible_hint", true);
          i2 = paramInt1;
          if (!(paramFragment.L))
          {
            paramFragment.K = true;
            i2 = paramInt1;
            if (paramInt1 > 3)
              i2 = 3;
          }
        }
        paramFragment.t = this.o;
        paramFragment.v = this.q;
        if (this.q != null);
        for (localObject1 = this.q.u; ; localObject1 = this.o.b)
        {
          paramFragment.s = ((m)localObject1);
          paramFragment.F = false;
          paramFragment.F = true;
          if (paramFragment.F)
            break;
          throw new z("Fragment " + paramFragment + " did not call through to super.onAttach()");
        }
        localObject1 = paramFragment.v;
        if (!(paramFragment.C))
        {
          localObject1 = paramFragment.d;
          if (paramFragment.u != null)
            paramFragment.u.s = false;
          paramFragment.F = false;
          paramFragment.F = true;
          if (!(paramFragment.F))
            throw new z("Fragment " + paramFragment + " did not call through to super.onCreate()");
          if (localObject1 != null)
          {
            localObject1 = ((Bundle)localObject1).getParcelable("android:support:fragments");
            if (localObject1 != null)
            {
              if (paramFragment.u == null)
              {
                paramFragment.u = new m();
                paramFragment.u.a(paramFragment.t, new d(paramFragment), paramFragment);
              }
              paramFragment.u.a((Parcelable)localObject1, null);
              paramFragment.u.g();
            }
          }
        }
        paramFragment.C = false;
        i1 = i2;
        if (!(paramFragment.o))
          break label685;
        localObject1 = paramFragment.d;
        paramFragment.t.getLayoutInflater();
        localObject1 = paramFragment.d;
        paramFragment.I = paramFragment.f();
        if (paramFragment.I == null)
          break label842;
        paramFragment.J = paramFragment.I;
        paramFragment.I = y.a(paramFragment.I);
        if (paramFragment.z)
          paramFragment.I.setVisibility(8);
        localObject1 = paramFragment.I;
        localObject1 = paramFragment.d;
        Fragment.d();
      case 1:
        for (i1 = i2; ; i1 = i2)
        {
          label685: i3 = i1;
          if (i1 <= 1)
            break label1215;
          if (a)
            Log.v("FragmentManager", "moveto ACTIVITY_CREATED: " + paramFragment);
          if (paramFragment.o)
            break label1031;
          if (paramFragment.x == 0)
            break label2337;
          localObject2 = (ViewGroup)this.p.a(paramFragment.x);
          localObject1 = localObject2;
          if (localObject2 != null)
            break label901;
          localObject1 = localObject2;
          if (paramFragment.q)
            break label901;
          localObject1 = new StringBuilder("No view found for id 0x").append(Integer.toHexString(paramFragment.x)).append(" (");
          if (paramFragment.t != null)
            break;
          throw new IllegalStateException("Fragment " + paramFragment + " not attached to Activity");
          label842: paramFragment.J = null;
        }
        a(new IllegalArgumentException(paramFragment.t.getResources().getResourceName(paramFragment.x) + ") for fragment " + paramFragment));
      case 2:
      case 3:
      case 4:
      }
    }
    for (Object localObject1 = localObject2; ; localObject1 = null)
    {
      while (true)
      {
        do
        {
          while (true)
          {
            do
            {
              label901: paramFragment.H = ((ViewGroup)localObject1);
              localObject2 = paramFragment.d;
              paramFragment.t.getLayoutInflater();
              localObject2 = paramFragment.d;
              paramFragment.I = paramFragment.f();
              if (paramFragment.I != null)
              {
                paramFragment.J = paramFragment.I;
                paramFragment.I = y.a(paramFragment.I);
                if (localObject1 != null)
                {
                  localObject2 = a(paramFragment, paramInt2, true, paramInt3);
                  if (localObject2 != null)
                    paramFragment.I.startAnimation((Animation)localObject2);
                  ((ViewGroup)localObject1).addView(paramFragment.I);
                }
                if (paramFragment.z)
                  paramFragment.I.setVisibility(8);
                localObject1 = paramFragment.I;
                localObject1 = paramFragment.d;
                Fragment.d();
              }
              while (true)
              {
                label1031: localObject1 = paramFragment.d;
                if (paramFragment.u != null)
                  paramFragment.u.s = false;
                paramFragment.F = false;
                paramFragment.F = true;
                if (paramFragment.F)
                  break;
                throw new z("Fragment " + paramFragment + " did not call through to super.onActivityCreated()");
                paramFragment.J = null;
              }
              if (paramFragment.u != null)
                paramFragment.u.h();
              if (paramFragment.I != null)
              {
                localObject1 = paramFragment.d;
                if (paramFragment.e != null)
                {
                  paramFragment.J.restoreHierarchyState(paramFragment.e);
                  paramFragment.e = null;
                }
                paramFragment.F = false;
                paramFragment.F = true;
                if (!(paramFragment.F))
                  throw new z("Fragment " + paramFragment + " did not call through to super.onViewStateRestored()");
              }
              paramFragment.d = null;
              i3 = i1;
              label1215: i2 = i3;
              if (i3 > 3)
              {
                if (a)
                  Log.v("FragmentManager", "moveto STARTED: " + paramFragment);
                paramFragment.g();
                i2 = i3;
              }
              i1 = i2;
            }
            while (i2 <= 4);
            if (a)
              Log.v("FragmentManager", "moveto RESUMED: " + paramFragment);
            paramFragment.n = true;
            if (paramFragment.u != null)
            {
              paramFragment.u.s = false;
              paramFragment.u.d();
            }
            paramFragment.F = false;
            paramFragment.F = true;
            if (!(paramFragment.F))
              throw new z("Fragment " + paramFragment + " did not call through to super.onResume()");
            if (paramFragment.u != null)
            {
              paramFragment.u.j();
              paramFragment.u.d();
            }
            paramFragment.d = null;
            paramFragment.e = null;
            i1 = i2;
          }
          i1 = paramInt1;
        }
        while (paramFragment.a <= paramInt1);
        switch (paramFragment.a)
        {
        default:
          i1 = paramInt1;
        case 1:
        case 5:
        case 4:
        case 3:
        case 2:
        }
      }
      do
      {
        while (true)
        {
          do
            i1 = paramInt1;
          while (paramInt1 > 0);
          if ((this.t) && (paramFragment.b != null))
          {
            localObject1 = paramFragment.b;
            paramFragment.b = null;
            ((View)localObject1).clearAnimation();
          }
          if (paramFragment.b == null)
            break label2010;
          paramFragment.c = paramInt1;
          i1 = 1;
        }
        if (paramInt1 < 5)
        {
          if (a)
            Log.v("FragmentManager", "movefrom RESUMED: " + paramFragment);
          if (paramFragment.u != null)
            paramFragment.u.a(4);
          paramFragment.F = false;
          paramFragment.F = true;
          if (!(paramFragment.F))
            throw new z("Fragment " + paramFragment + " did not call through to super.onPause()");
          paramFragment.n = false;
        }
        if (paramInt1 < 4)
        {
          if (a)
            Log.v("FragmentManager", "movefrom STARTED: " + paramFragment);
          if (paramFragment.u != null)
            paramFragment.u.k();
          paramFragment.F = false;
          paramFragment.F = true;
          if (!(paramFragment.F))
            throw new z("Fragment " + paramFragment + " did not call through to super.onStop()");
        }
        if (paramInt1 >= 3)
          continue;
        if (a)
          Log.v("FragmentManager", "movefrom STOPPED: " + paramFragment);
        paramFragment.h();
      }
      while (paramInt1 >= 2);
      if (a)
        Log.v("FragmentManager", "movefrom ACTIVITY_CREATED: " + paramFragment);
      if ((paramFragment.I != null) && (!(this.o.isFinishing())) && (paramFragment.e == null))
        b(paramFragment);
      if (paramFragment.u != null)
        paramFragment.u.a(1);
      paramFragment.F = false;
      paramFragment.F = true;
      if (!(paramFragment.F))
        throw new z("Fragment " + paramFragment + " did not call through to super.onDestroyView()");
      if (paramFragment.M != null)
        paramFragment.M.e();
      if ((paramFragment.I != null) && (paramFragment.H != null))
        if ((this.n <= 0) || (this.t))
          break label2331;
      label2315: label2331: label2337: for (localObject1 = a(paramFragment, paramInt2, false, paramInt3); ; localObject1 = null)
        while (true)
        {
          while (true)
          {
            do
            {
              do
              {
                while (true)
                {
                  if (localObject1 != null)
                  {
                    paramFragment.b = paramFragment.I;
                    paramFragment.c = paramInt1;
                    ((Animation)localObject1).setAnimationListener(new o(this, paramFragment));
                    paramFragment.I.startAnimation((Animation)localObject1);
                  }
                  paramFragment.H.removeView(paramFragment.I);
                  paramFragment.H = null;
                  paramFragment.I = null;
                  paramFragment.J = null;
                }
                if (a)
                  label2010: Log.v("FragmentManager", "movefrom CREATED: " + paramFragment);
                if (!(paramFragment.C))
                  paramFragment.i();
                paramFragment.F = false;
                paramFragment.F = true;
                if (!(paramFragment.F))
                  throw new z("Fragment " + paramFragment + " did not call through to super.onDetach()");
                i1 = paramInt1;
              }
              while (paramBoolean);
              if (paramFragment.C)
                break label2315;
              i1 = paramInt1;
            }
            while (paramFragment.f < 0);
            if (a)
              Log.v("FragmentManager", "Freeing fragment index " + paramFragment);
            this.f.set(paramFragment.f, null);
            if (this.h == null)
              this.h = new ArrayList();
            this.h.add(Integer.valueOf(paramFragment.f));
            this.o.a(paramFragment.g);
            paramFragment.f = -1;
            paramFragment.g = null;
            paramFragment.l = false;
            paramFragment.m = false;
            paramFragment.n = false;
            paramFragment.o = false;
            paramFragment.p = false;
            paramFragment.q = false;
            paramFragment.r = 0;
            paramFragment.s = null;
            paramFragment.t = null;
            paramFragment.w = 0;
            paramFragment.x = 0;
            paramFragment.y = null;
            paramFragment.z = false;
            paramFragment.A = false;
            paramFragment.C = false;
            paramFragment.M = null;
            paramFragment.N = false;
            paramFragment.O = false;
            i1 = paramInt1;
          }
          paramFragment.t = null;
          paramFragment.s = null;
          i1 = paramInt1;
        }
    }
  }

  public final void a(Fragment paramFragment, boolean paramBoolean)
  {
    if (this.g == null)
      this.g = new ArrayList();
    if (a)
      Log.v("FragmentManager", "add: " + paramFragment);
    if (paramFragment.f < 0)
    {
      if ((this.h != null) && (this.h.size() > 0))
        break label185;
      if (this.f == null)
        this.f = new ArrayList();
      paramFragment.a(this.f.size(), this.q);
      this.f.add(paramFragment);
    }
    while (true)
    {
      if (a)
        Log.v("FragmentManager", "Allocated fragment index " + paramFragment);
      if (paramFragment.A)
        return;
      if (!(this.g.contains(paramFragment)))
        break;
      throw new IllegalStateException("Fragment already added: " + paramFragment);
      label185: paramFragment.a(((Integer)this.h.remove(this.h.size() - 1)).intValue(), this.q);
      this.f.set(paramFragment.f, paramFragment);
    }
    this.g.add(paramFragment);
    paramFragment.l = true;
    paramFragment.m = false;
    if ((paramFragment.D) && (paramFragment.E))
      this.r = true;
    if (!(paramBoolean))
      return;
    a(paramFragment);
  }

  public final void a(FragmentActivity paramFragmentActivity, k paramk, Fragment paramFragment)
  {
    if (this.o != null)
      throw new IllegalStateException("Already attached");
    this.o = paramFragmentActivity;
    this.p = paramk;
    this.q = paramFragment;
  }

  public final void a(Runnable paramRunnable)
  {
    o();
    monitorenter;
    try
    {
      throw new IllegalStateException("Activity has been destroyed");
    }
    finally
    {
      monitorexit;
    }
    if (this.c == null)
      this.c = new ArrayList();
    this.c.add(paramRunnable);
    if (this.c.size() == 1)
    {
      this.o.a.removeCallbacks(this.y);
      this.o.a.post(this.y);
    }
    monitorexit;
  }

  public final void a(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] paramArrayOfString)
  {
    int i1;
    int i3;
    int i2 = 0;
    String str = paramString + "    ";
    if (this.f != null)
    {
      i3 = this.f.size();
      if (i3 > 0)
      {
        paramPrintWriter.print(paramString);
        paramPrintWriter.print("Active Fragments in ");
        paramPrintWriter.print(Integer.toHexString(System.identityHashCode(this)));
        paramPrintWriter.println(":");
        i1 = 0;
        while (i1 < i3)
        {
          Fragment localFragment = (Fragment)this.f.get(i1);
          paramPrintWriter.print(paramString);
          paramPrintWriter.print("  #");
          paramPrintWriter.print(i1);
          paramPrintWriter.print(": ");
          paramPrintWriter.println(localFragment);
          if (localFragment != null)
          {
            paramPrintWriter.print(str);
            paramPrintWriter.print("mFragmentId=#");
            paramPrintWriter.print(Integer.toHexString(localFragment.w));
            paramPrintWriter.print(" mContainerId=#");
            paramPrintWriter.print(Integer.toHexString(localFragment.x));
            paramPrintWriter.print(" mTag=");
            paramPrintWriter.println(localFragment.y);
            paramPrintWriter.print(str);
            paramPrintWriter.print("mState=");
            paramPrintWriter.print(localFragment.a);
            paramPrintWriter.print(" mIndex=");
            paramPrintWriter.print(localFragment.f);
            paramPrintWriter.print(" mWho=");
            paramPrintWriter.print(localFragment.g);
            paramPrintWriter.print(" mBackStackNesting=");
            paramPrintWriter.println(localFragment.r);
            paramPrintWriter.print(str);
            paramPrintWriter.print("mAdded=");
            paramPrintWriter.print(localFragment.l);
            paramPrintWriter.print(" mRemoving=");
            paramPrintWriter.print(localFragment.m);
            paramPrintWriter.print(" mResumed=");
            paramPrintWriter.print(localFragment.n);
            paramPrintWriter.print(" mFromLayout=");
            paramPrintWriter.print(localFragment.o);
            paramPrintWriter.print(" mInLayout=");
            paramPrintWriter.println(localFragment.p);
            paramPrintWriter.print(str);
            paramPrintWriter.print("mHidden=");
            paramPrintWriter.print(localFragment.z);
            paramPrintWriter.print(" mDetached=");
            paramPrintWriter.print(localFragment.A);
            paramPrintWriter.print(" mMenuVisible=");
            paramPrintWriter.print(localFragment.E);
            paramPrintWriter.print(" mHasMenu=");
            paramPrintWriter.println(localFragment.D);
            paramPrintWriter.print(str);
            paramPrintWriter.print("mRetainInstance=");
            paramPrintWriter.print(localFragment.B);
            paramPrintWriter.print(" mRetaining=");
            paramPrintWriter.print(localFragment.C);
            paramPrintWriter.print(" mUserVisibleHint=");
            paramPrintWriter.println(localFragment.L);
            if (localFragment.s != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mFragmentManager=");
              paramPrintWriter.println(localFragment.s);
            }
            if (localFragment.t != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mActivity=");
              paramPrintWriter.println(localFragment.t);
            }
            if (localFragment.v != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mParentFragment=");
              paramPrintWriter.println(localFragment.v);
            }
            if (localFragment.h != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mArguments=");
              paramPrintWriter.println(localFragment.h);
            }
            if (localFragment.d != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mSavedFragmentState=");
              paramPrintWriter.println(localFragment.d);
            }
            if (localFragment.e != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mSavedViewState=");
              paramPrintWriter.println(localFragment.e);
            }
            if (localFragment.i != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mTarget=");
              paramPrintWriter.print(localFragment.i);
              paramPrintWriter.print(" mTargetRequestCode=");
              paramPrintWriter.println(localFragment.k);
            }
            if (localFragment.G != 0)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mNextAnim=");
              paramPrintWriter.println(localFragment.G);
            }
            if (localFragment.H != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mContainer=");
              paramPrintWriter.println(localFragment.H);
            }
            if (localFragment.I != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mView=");
              paramPrintWriter.println(localFragment.I);
            }
            if (localFragment.J != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mInnerView=");
              paramPrintWriter.println(localFragment.I);
            }
            if (localFragment.b != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.print("mAnimatingAway=");
              paramPrintWriter.println(localFragment.b);
              paramPrintWriter.print(str);
              paramPrintWriter.print("mStateAfterAnimating=");
              paramPrintWriter.println(localFragment.c);
            }
            if (localFragment.M != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.println("Loader Manager:");
              localFragment.M.a(str + "  ", paramPrintWriter);
            }
            if (localFragment.u != null)
            {
              paramPrintWriter.print(str);
              paramPrintWriter.println("Child " + localFragment.u + ":");
              localFragment.u.a(str + "  ", paramFileDescriptor, paramPrintWriter, paramArrayOfString);
            }
          }
          i1 += 1;
        }
      }
    }
    if (this.g != null)
    {
      i3 = this.g.size();
      if (i3 > 0)
      {
        paramPrintWriter.print(paramString);
        paramPrintWriter.println("Added Fragments:");
        i1 = 0;
        while (i1 < i3)
        {
          paramFileDescriptor = (Fragment)this.g.get(i1);
          paramPrintWriter.print(paramString);
          paramPrintWriter.print("  #");
          paramPrintWriter.print(i1);
          paramPrintWriter.print(": ");
          paramPrintWriter.println(paramFileDescriptor.toString());
          i1 += 1;
        }
      }
    }
    if (this.j != null)
    {
      i3 = this.j.size();
      if (i3 > 0)
      {
        paramPrintWriter.print(paramString);
        paramPrintWriter.println("Fragments Created Menus:");
        i1 = 0;
        while (i1 < i3)
        {
          paramFileDescriptor = (Fragment)this.j.get(i1);
          paramPrintWriter.print(paramString);
          paramPrintWriter.print("  #");
          paramPrintWriter.print(i1);
          paramPrintWriter.print(": ");
          paramPrintWriter.println(paramFileDescriptor.toString());
          i1 += 1;
        }
      }
    }
    if (this.i != null)
    {
      i3 = this.i.size();
      if (i3 > 0)
      {
        paramPrintWriter.print(paramString);
        paramPrintWriter.println("Back Stack:");
        i1 = 0;
        while (i1 < i3)
        {
          paramFileDescriptor = (a)this.i.get(i1);
          paramPrintWriter.print(paramString);
          paramPrintWriter.print("  #");
          paramPrintWriter.print(i1);
          paramPrintWriter.print(": ");
          paramPrintWriter.println(paramFileDescriptor.toString());
          paramFileDescriptor.a(str, paramPrintWriter);
          i1 += 1;
        }
      }
    }
    monitorenter;
    try
    {
      if (this.k != null)
      {
        i3 = this.k.size();
        if (i3 > 0)
        {
          paramPrintWriter.print(paramString);
          paramPrintWriter.println("Back Stack Indices:");
          i1 = 0;
          while (i1 < i3)
          {
            paramFileDescriptor = (a)this.k.get(i1);
            paramPrintWriter.print(paramString);
            paramPrintWriter.print("  #");
            paramPrintWriter.print(i1);
            paramPrintWriter.print(": ");
            paramPrintWriter.println(paramFileDescriptor);
            i1 += 1;
          }
        }
      }
      if ((this.l != null) && (this.l.size() > 0))
      {
        paramPrintWriter.print(paramString);
        paramPrintWriter.print("mAvailBackStackIndices: ");
        paramPrintWriter.println(Arrays.toString(this.l.toArray()));
      }
      monitorexit;
      if (this.c == null)
        break label1556;
      i3 = this.c.size();
      if (i3 <= 0)
        break label1556;
      paramPrintWriter.print(paramString);
      paramPrintWriter.println("Pending Actions:");
      i1 = i2;
      if (i1 >= i3)
        break label1556;
      paramFileDescriptor = (Runnable)this.c.get(i1);
      paramPrintWriter.print(paramString);
      paramPrintWriter.print("  #");
      paramPrintWriter.print(i1);
      paramPrintWriter.print(": ");
      paramPrintWriter.println(paramFileDescriptor);
    }
    finally
    {
      monitorexit;
    }
    label1556: paramPrintWriter.print(paramString);
    paramPrintWriter.println("FragmentManager misc state:");
    paramPrintWriter.print(paramString);
    paramPrintWriter.print("  mActivity=");
    paramPrintWriter.println(this.o);
    paramPrintWriter.print(paramString);
    paramPrintWriter.print("  mContainer=");
    paramPrintWriter.println(this.p);
    if (this.q != null)
    {
      paramPrintWriter.print(paramString);
      paramPrintWriter.print("  mParent=");
      paramPrintWriter.println(this.q);
    }
    paramPrintWriter.print(paramString);
    paramPrintWriter.print("  mCurState=");
    paramPrintWriter.print(this.n);
    paramPrintWriter.print(" mStateSaved=");
    paramPrintWriter.print(this.s);
    paramPrintWriter.print(" mDestroyed=");
    paramPrintWriter.println(this.t);
    if (this.r)
    {
      paramPrintWriter.print(paramString);
      paramPrintWriter.print("  mNeedMenuInvalidate=");
      paramPrintWriter.println(this.r);
    }
    if (this.u != null)
    {
      paramPrintWriter.print(paramString);
      paramPrintWriter.print("  mNoTransactionsBecause=");
      paramPrintWriter.println(this.u);
    }
    if ((this.h == null) || (this.h.size() <= 0))
      return;
    paramPrintWriter.print(paramString);
    paramPrintWriter.print("  mAvailIndices: ");
    paramPrintWriter.println(Arrays.toString(this.h.toArray()));
  }

  public final boolean a(Menu paramMenu)
  {
    boolean bool1;
    int i1;
    int i2;
    int i3;
    Fragment localFragment;
    if (this.g != null)
    {
      i1 = 0;
      i2 = 0;
      i3 = i2;
      if (i1 >= this.g.size())
        break label127;
      localFragment = (Fragment)this.g.get(i1);
      i3 = i2;
      if (localFragment != null)
      {
        if (localFragment.z)
          break label135;
        if ((!(localFragment.D)) || (!(localFragment.E)))
          break label130;
        bool1 = true;
        bool2 = bool1;
        if (localFragment.u == null);
      }
    }
    label130: label135: for (boolean bool2 = bool1 | localFragment.u.a(paramMenu); ; bool2 = false)
      while (true)
      {
        while (true)
        {
          i3 = i2;
          if (bool2)
            i3 = 1;
          i1 += 1;
          i2 = i3;
        }
        i3 = 0;
        label127: return i3;
        bool1 = false;
      }
  }

  public final boolean a(Menu paramMenu, MenuInflater paramMenuInflater)
  {
    int i1;
    int i3;
    int i5;
    int i6;
    Fragment localFragment;
    int i4 = 0;
    Object localObject2 = null;
    Object localObject1 = null;
    if (this.g != null)
    {
      i3 = 0;
      i5 = 0;
      localObject2 = localObject1;
      i6 = i5;
      if (i3 >= this.g.size())
        break label162;
      localFragment = (Fragment)this.g.get(i3);
      if (localFragment == null)
        break label228;
      if (localFragment.z)
        break label236;
      if ((!(localFragment.D)) || (!(localFragment.E)))
        break label231;
      i1 = 1;
      int i2 = i1;
      if (localFragment.u == null);
    }
    label162: label228: label231: label236: for (boolean bool = i1 | localFragment.u.a(paramMenu, paramMenuInflater); ; bool = false)
      while (true)
      {
        if (bool)
        {
          localObject2 = localObject1;
          if (localObject1 == null)
            localObject2 = new ArrayList();
          ((ArrayList)localObject2).add(localFragment);
          i5 = 1;
          localObject1 = localObject2;
        }
        while (true)
        {
          while (true)
            i3 += 1;
          i6 = 0;
          if (this.j != null)
          {
            i1 = i4;
            while (i1 < this.j.size())
            {
              paramMenu = (Fragment)this.j.get(i1);
              if ((localObject2 == null) || (!(((ArrayList)localObject2).contains(paramMenu))))
                Fragment.e();
              i1 += 1;
            }
          }
          this.j = ((ArrayList)localObject2);
          return i6;
        }
        i1 = 0;
      }
  }

  public final boolean a(MenuItem paramMenuItem)
  {
    int i1;
    int i4 = 0;
    int i3 = i4;
    if (this.g != null)
      i1 = 0;
    while (true)
    {
      i3 = i4;
      if (i1 < this.g.size())
      {
        Fragment localFragment = (Fragment)this.g.get(i1);
        if (localFragment == null)
          break label94;
        if ((localFragment.z) || (localFragment.u == null) || (!(localFragment.u.a(paramMenuItem))))
          break label89;
      }
      for (int i2 = 1; i2 != 0; i2 = 0)
      {
        i3 = 1;
        label89: return i3;
      }
      label94: i1 += 1;
    }
  }

  public final Fragment b(int paramInt)
  {
    int i1;
    Object localObject;
    if (this.g != null)
    {
      i1 = this.g.size() - 1;
      while (i1 >= 0)
      {
        localObject = (Fragment)this.g.get(i1);
        if ((localObject != null) && (((Fragment)localObject).w == paramInt))
          return localObject;
        i1 -= 1;
      }
    }
    if (this.f != null)
    {
      i1 = this.f.size() - 1;
      while (i1 >= 0)
      {
        Fragment localFragment;
        do
        {
          localFragment = (Fragment)this.f.get(i1);
          if (localFragment == null)
            break;
          localObject = localFragment;
        }
        while (localFragment.w == paramInt);
        i1 -= 1;
      }
    }
    return ((Fragment)null);
  }

  public final void b(Fragment paramFragment, int paramInt1, int paramInt2)
  {
    if (a)
      Log.v("FragmentManager", "hide: " + paramFragment);
    if (paramFragment.z)
      return;
    paramFragment.z = true;
    if (paramFragment.I != null)
    {
      Animation localAnimation = a(paramFragment, paramInt1, true, paramInt2);
      if (localAnimation != null)
        paramFragment.I.startAnimation(localAnimation);
      paramFragment.I.setVisibility(8);
    }
    if ((paramFragment.l) && (paramFragment.D) && (paramFragment.E))
      this.r = true;
    Fragment.a();
  }

  public final void b(Menu paramMenu)
  {
    if (this.g == null)
      return;
    int i1 = 0;
    while (i1 < this.g.size())
    {
      Fragment localFragment = (Fragment)this.g.get(i1);
      if ((localFragment != null) && (!(localFragment.z)) && (localFragment.u != null))
        localFragment.u.b(paramMenu);
      i1 += 1;
    }
  }

  public final boolean b()
  {
    return d();
  }

  public final boolean b(MenuItem paramMenuItem)
  {
    int i1;
    int i4 = 0;
    int i3 = i4;
    if (this.g != null)
      i1 = 0;
    while (true)
    {
      i3 = i4;
      if (i1 < this.g.size())
      {
        Fragment localFragment = (Fragment)this.g.get(i1);
        if (localFragment == null)
          break label94;
        if ((localFragment.z) || (localFragment.u == null) || (!(localFragment.u.b(paramMenuItem))))
          break label89;
      }
      for (int i2 = 1; i2 != 0; i2 = 0)
      {
        i3 = 1;
        label89: return i3;
      }
      label94: i1 += 1;
    }
  }

  public final void c(Fragment paramFragment, int paramInt1, int paramInt2)
  {
    if (a)
      Log.v("FragmentManager", "show: " + paramFragment);
    if (!(paramFragment.z))
      return;
    paramFragment.z = false;
    if (paramFragment.I != null)
    {
      Animation localAnimation = a(paramFragment, paramInt1, true, paramInt2);
      if (localAnimation != null)
        paramFragment.I.startAnimation(localAnimation);
      paramFragment.I.setVisibility(0);
    }
    if ((paramFragment.l) && (paramFragment.D) && (paramFragment.E))
      this.r = true;
    Fragment.a();
  }

  public final boolean c()
  {
    int i1;
    o();
    d();
    if (this.i == null);
    do
    {
      return false;
      i1 = this.i.size() - 1;
    }
    while (i1 < 0);
    a locala = (a)this.i.remove(i1);
    if (a)
    {
      Log.v("FragmentManager", "popFromBackStack: " + locala);
      locala.a("  ", new PrintWriter(new android.support.v4.c.b("FragmentManager")));
    }
    locala.a(-1);
    Object localObject1 = locala.c;
    if (localObject1 != null)
    {
      Fragment localFragment;
      switch (((b)localObject1).c)
      {
      default:
        throw new IllegalArgumentException("Unknown cmd: " + ((b)localObject1).c);
      case 1:
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).h;
        locala.a.a(localFragment, c(locala.i), locala.j);
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      }
      while (true)
      {
        while (true)
          localObject1 = ((b)localObject1).b;
        localFragment = ((b)localObject1).d;
        if (localFragment != null)
        {
          localFragment.G = ((b)localObject1).h;
          locala.a.a(localFragment, c(locala.i), locala.j);
        }
        if (((b)localObject1).i == null)
          continue;
        i1 = 0;
        while (true)
        {
          if (i1 < ((b)localObject1).i.size());
          localFragment = (Fragment)((b)localObject1).i.get(i1);
          localFragment.G = ((b)localObject1).g;
          locala.a.a(localFragment, false);
          i1 += 1;
        }
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).g;
        locala.a.a(localFragment, false);
        continue;
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).g;
        locala.a.c(localFragment, c(locala.i), locala.j);
        continue;
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).h;
        locala.a.b(localFragment, c(locala.i), locala.j);
        continue;
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).g;
        locala.a.e(localFragment, c(locala.i), locala.j);
        continue;
        localFragment = ((b)localObject1).d;
        localFragment.G = ((b)localObject1).g;
        locala.a.d(localFragment, c(locala.i), locala.j);
      }
    }
    locala.a.a(locala.a.n, c(locala.i), locala.j, true);
    if (locala.o >= 0)
    {
      localObject1 = locala.a;
      i1 = locala.o;
      monitorenter;
    }
    try
    {
      ((m)localObject1).k.set(i1, null);
      if (((m)localObject1).l == null)
        ((m)localObject1).l = new ArrayList();
      if (a)
        Log.v("FragmentManager", "Freeing back stack index " + i1);
      ((m)localObject1).l.add(Integer.valueOf(i1));
      monitorexit;
      locala.o = -1;
      return true;
    }
    finally
    {
      monitorexit;
    }
  }

  public final void d(Fragment paramFragment, int paramInt1, int paramInt2)
  {
    if (a)
      Log.v("FragmentManager", "detach: " + paramFragment);
    if (paramFragment.A)
      return;
    paramFragment.A = true;
    if (!(paramFragment.l))
      return;
    if (this.g != null)
    {
      if (a)
        Log.v("FragmentManager", "remove from detach: " + paramFragment);
      this.g.remove(paramFragment);
    }
    if ((paramFragment.D) && (paramFragment.E))
      this.r = true;
    paramFragment.l = false;
    a(paramFragment, 1, paramInt1, paramInt2, false);
  }

  public final boolean d()
  {
    int i2;
    if (this.e)
      throw new IllegalStateException("Recursive entry to executePendingTransactions");
    if (Looper.myLooper() != this.o.a.getLooper())
      throw new IllegalStateException("Must be called from main thread of process");
    for (int i5 = 0; ; i5 = 1)
    {
      int i1;
      monitorenter;
      try
      {
        if ((this.c == null) || (this.c.size() == 0))
        {
          int i4;
          monitorexit;
          if (!(this.v))
            break label276;
          i1 = 0;
          for (i2 = 0; ; i2 = i4)
          {
            if (i1 >= this.f.size())
              break label263;
            Fragment localFragment = (Fragment)this.f.get(i1);
            int i3 = i2;
            if (localFragment != null)
            {
              i3 = i2;
              if (localFragment.M != null)
                i4 = i2 | localFragment.M.a();
            }
            i1 += 1;
          }
        }
        i2 = this.c.size();
        if ((this.d == null) || (this.d.length < i2))
          this.d = new Runnable[i2];
        this.c.toArray(this.d);
        this.c.clear();
        this.o.a.removeCallbacks(this.y);
        monitorexit;
        this.e = true;
        i1 = 0;
        if (i1 >= i2)
          break label252;
        this.d[i1].run();
        this.d[i1] = null;
      }
      finally
      {
        monitorexit;
      }
      label252: this.e = false;
    }
    if (i2 == 0)
    {
      label263: this.v = false;
      n();
    }
    label276: return i5;
  }

  final void e()
  {
    if (this.m == null)
      return;
    int i1 = 0;
    while (i1 < this.m.size())
    {
      this.m.get(i1);
      i1 += 1;
    }
  }

  public final void e(Fragment paramFragment, int paramInt1, int paramInt2)
  {
    if (a)
      Log.v("FragmentManager", "attach: " + paramFragment);
    if (!(paramFragment.A))
      return;
    paramFragment.A = false;
    if (paramFragment.l)
      return;
    if (this.g == null)
      this.g = new ArrayList();
    if (this.g.contains(paramFragment))
      throw new IllegalStateException("Fragment already added: " + paramFragment);
    if (a)
      Log.v("FragmentManager", "add from attach: " + paramFragment);
    this.g.add(paramFragment);
    paramFragment.l = true;
    if ((paramFragment.D) && (paramFragment.E))
      this.r = true;
    a(paramFragment, this.n, paramInt1, paramInt2, false);
  }

  final Parcelable f()
  {
    Object localObject1;
    Object localObject2;
    Fragment localFragment;
    FragmentState localFragmentState;
    Object localObject3 = null;
    d();
    if (b)
      this.s = true;
    if ((this.f == null) || (this.f.size() <= 0))
      return null;
    int i3 = this.f.size();
    FragmentState[] arrayOfFragmentState = new FragmentState[i3];
    int i2 = 0;
    int i1 = 0;
    if (i2 < i3)
    {
      localFragment = (Fragment)this.f.get(i2);
      if (localFragment == null)
        break label933;
      if (localFragment.f < 0)
        a(new IllegalStateException("Failure saving state: active " + localFragment + " has cleared index: " + localFragment.f));
      localFragmentState = new FragmentState(localFragment);
      arrayOfFragmentState[i2] = localFragmentState;
      if ((localFragment.a > 0) && (localFragmentState.j == null))
      {
        if (this.w == null)
          this.w = new Bundle();
        localObject1 = this.w;
        if (localFragment.u != null)
        {
          localObject2 = localFragment.u.f();
          if (localObject2 != null)
            ((Bundle)localObject1).putParcelable("android:support:fragments", (Parcelable)localObject2);
        }
        if (this.w.isEmpty())
          break label927;
        localObject2 = this.w;
        this.w = null;
        if (localFragment.I != null)
          b(localFragment);
        localObject1 = localObject2;
        if (localFragment.e != null)
        {
          localObject1 = localObject2;
          if (localObject2 == null)
            localObject1 = new Bundle();
          ((Bundle)localObject1).putSparseParcelableArray("android:view_state", localFragment.e);
        }
        localObject2 = localObject1;
        if (!(localFragment.L))
        {
          localObject2 = localObject1;
          if (localObject1 == null)
            localObject2 = new Bundle();
          ((Bundle)localObject2).putBoolean("android:user_visible_hint", localFragment.L);
        }
        localFragmentState.j = ((Bundle)localObject2);
        if (localFragment.i != null)
        {
          if (localFragment.i.f < 0)
            a(new IllegalStateException("Failure saving state: " + localFragment + " has target not in fragment manager: " + localFragment.i));
          if (localFragmentState.j == null)
            localFragmentState.j = new Bundle();
          localObject1 = localFragmentState.j;
          localObject2 = localFragment.i;
          if (((Fragment)localObject2).f < 0)
            a(new IllegalStateException("Fragment " + localObject2 + " is not currently in the FragmentManager"));
          ((Bundle)localObject1).putInt("android:target_state", ((Fragment)localObject2).f);
          if (localFragment.k != 0)
            localFragmentState.j.putInt("android:target_req_state", localFragment.k);
        }
        if (a)
          Log.v("FragmentManager", "Saved state of " + localFragment + ": " + localFragmentState.j);
        i1 = 1;
      }
    }
    label775: label927: label933: 
    while (true)
      while (true)
      {
        do
        {
          while (true)
          {
            while (true)
              i2 += 1;
            localFragmentState.j = localFragment.d;
          }
          if (i1 != 0)
            break label611;
        }
        while (!(a));
        Log.v("FragmentManager", "saveAllState: no fragments!");
        return null;
        if (this.g != null)
        {
          label611: i2 = this.g.size();
          if (i2 > 0)
          {
            localObject2 = new int[i2];
            i1 = 0;
            while (true)
            {
              localObject1 = localObject2;
              if (i1 >= i2)
                break label775;
              localObject2[i1] = ((Fragment)this.g.get(i1)).f;
              if (localObject2[i1] < 0)
                a(new IllegalStateException("Failure saving state: active " + this.g.get(i1) + " has cleared index: " + localObject2[i1]));
              if (a)
                Log.v("FragmentManager", "saveAllState: adding fragment #" + i1 + ": " + this.g.get(i1));
              i1 += 1;
            }
          }
        }
        localObject1 = null;
        localObject2 = localObject3;
        if (this.i != null)
        {
          i2 = this.i.size();
          localObject2 = localObject3;
          if (i2 > 0)
          {
            localObject3 = new BackStackState[i2];
            i1 = 0;
            while (true)
            {
              localObject2 = localObject3;
              if (i1 >= i2)
                break;
              localObject3[i1] = new BackStackState((a)this.i.get(i1));
              if (a)
                Log.v("FragmentManager", "saveAllState: adding back stack #" + i1 + ": " + this.i.get(i1));
              i1 += 1;
            }
          }
        }
        localObject3 = new FragmentManagerState();
        ((FragmentManagerState)localObject3).a = arrayOfFragmentState;
        ((FragmentManagerState)localObject3).b = ((I)localObject1);
        ((FragmentManagerState)localObject3).c = ((BackStackState)localObject2);
        return localObject3;
        localObject2 = null;
      }
  }

  public final void g()
  {
    this.s = false;
    a(1);
  }

  public final void h()
  {
    this.s = false;
    a(2);
  }

  public final void i()
  {
    this.s = false;
    a(4);
  }

  public final void j()
  {
    this.s = false;
    a(5);
  }

  public final void k()
  {
    this.s = true;
    a(3);
  }

  public final void l()
  {
    this.t = true;
    d();
    a(0);
    this.o = null;
    this.p = null;
    this.q = null;
  }

  public final void m()
  {
    if (this.g == null)
      return;
    int i1 = 0;
    while (i1 < this.g.size())
    {
      Fragment localFragment = (Fragment)this.g.get(i1);
      if (localFragment != null)
      {
        localFragment.onLowMemory();
        if (localFragment.u != null)
          localFragment.u.m();
      }
      i1 += 1;
    }
  }

  public final String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder(128);
    localStringBuilder.append("FragmentManager{");
    localStringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
    localStringBuilder.append(" in ");
    if (this.q != null)
      android.support.v4.c.a.a(this.q, localStringBuilder);
    while (true)
    {
      localStringBuilder.append("}}");
      return localStringBuilder.toString();
      android.support.v4.c.a.a(this.o, localStringBuilder);
    }
  }
}